home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 May: Tool Chest / Dev.CD May 98 TC.toast / Tool Chest / Testing & Debugging / Virtual User tools / SPEC S&L v.1.0.1 / Scripts / MacWrite.vu < prev    next >
Encoding:
Text File  |  1993-12-17  |  8.0 KB  |  211 lines  |  [TEXT/MPS ]

  1. #
  2. # ****************************************************************************
  3. #
  4. #    File Name:        MacWrite.vu
  5. #
  6. #    Contains:    Quick look test script for MacWrite II version 1.1v3
  7. #
  8. #    Written by:    Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
  9. #
  10. #    Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  11. #
  12. # ****************************************************************************
  13. #            C h a n g e        H i s t o r y (most recent first):
  14. # ****************************************************************************
  15. #
  16. #        Vers      Date        Author        Description
  17. #        ----    --------    ------    ---------------------------------------------
  18. #     <1.0.6>     9/30/93    KTA        Initialize gFileName prior to gApptitle being updated by
  19. #                                    launchTwitch().
  20. #     <1.0.5>     9/23/93    KTA        WordProcessor.Lib was not defined as a dependancy.
  21. #     <1.0.2>     6/16/93    NAGA        Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
  22. #        <1+>     5/25/93    NAGA        Adding header and porting old files to follow new standards
  23. #
  24. # ****************************************************************************
  25. #
  26.  
  27.  
  28.  
  29. ########################################################################
  30. #                            External libraries 
  31. #=======================================================================
  32. Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib", "WordProcessor.Lib";
  33.  
  34.  
  35. #########################################################################
  36. ########               Application Specific Tasks
  37. #########################################################################
  38.  
  39.  
  40. #########################################################################
  41. #                        InitAppGlobals()
  42. #========================================================================
  43. # Author:        ML
  44. # Description:    Sets up the app's globals.
  45. # Parameters:    None
  46. # Returns:        Nothing
  47. # Application:    Word
  48. # Examples:        InitAppGlobals()
  49. #========================================================================
  50. # History:
  51. #
  52. ########################################################################
  53. task InitAppGlobals()
  54. begin
  55.  
  56.     logstr("setting up {global gApptitle}'s globals");            
  57.                 
  58.     global kClick, kDrag, kDragClick, kMultiDrag, kMultiClickDrag, kMultiClick;
  59.     global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
  60.     global kTabPaletteNum := 1; 
  61.     global kAlignPaletteNum := 2;
  62.     global kSpacingPaletteNum := 3;
  63.     global kIncSpacePaletteNum := 4;
  64.  
  65.     #global gTextStr;
  66.     
  67.     global gPaletteList :=    {
  68.                             {                        #### Start Palette #1 - Tabs
  69.                             {76,52,166,65,0},        # Location of tab palette relative to the window
  70.                             kPalDocWind,            # Palette type
  71.                             {4,1},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  72.                             {24,12},                # Offset between tools {h,v}
  73.                             0,                        # Not used at this time
  74.                             0                        # Not used at this time
  75.                             },                        #### End Palette #1
  76.                             {                        #### Start Palette #2 - Alignment
  77.                             {434,52,525,65,0},        # Location of alignment palette relative to the window
  78.                             kPalDocWind,            # Palette type
  79.                             {4,1},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  80.                             {24,12},                # Offset between tools {h,v}
  81.                             0,                        # Not used at this time
  82.                             0                        # Not used at this time
  83.                             },                        #### End Palette #2
  84.                             {                        #### Start Palette #3 - Line spacing
  85.                             {244,52,311,65,0},        # Location of Line spacing palette relative to the window
  86.                             kPalDocWind,            # Palette type
  87.                             {3,1},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  88.                             {24,12},                    # Offset between tools {h,v}
  89.                             0,                        # Not used at this time
  90.                             0                        # Not used at this time
  91.                             },                        #### End Palette #3
  92.                             {                        #### Start Palette #4 - Incremental Line spacing
  93.                             {317,52,335,65,0},        # Location of Line Paragraph spacing palette relative to the window
  94.                             kPalDocWind,            # Palette type
  95.                             {2,1},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  96.                             {8,12},                    # Offset between tools {h,v}
  97.                             0,                        # Not used at this time
  98.                             0                        # Not used at this time
  99.                             }                        # End Palette #4
  100.     };
  101.  
  102.     ### Word                                                                            {Flag, Pattern, Line, Color}
  103.     ### Palette Elements:=        Tool#, Pal#,     ToolName,     ToolType,    DblClktoEnd        SetAttributes
  104.     global TabLeftTool :=         { 1,  1,        "Tab Left",        kDragClick, 0,            {0}                };
  105.     global TabCenterTool :=     { 2,  1,        "Tab Center",    kDragClick, 0,            {0}                };
  106.     global TabRightTool :=         { 3,  1,        "Tab Right",    kDragClick, 0,            {0}                };
  107.     global TabAlignOnTool :=     { 4,  1,        "Tab Align On",    kDragClick, 0,            {0}                };
  108.     global AlignLeftTool :=     { 1,  2,        "Align Left",    0,         0,                {0}                };
  109.     global AlignCenterTool :=     { 2,  2,        "Align Center",    0,         0,                {0}                };
  110.     global AlignRightTool :=     { 3,  2,        "Align Right",    0,         0,                {0}                };
  111.     global AlignLRTool :=         { 4,  2,        "Align LR",        0,         0,                {0}                };
  112.     global SingleSpaceTool :=     { 1,  3,        "Single Space",    0,         0,                {0}                };
  113.     global xSpaceTool :=         { 2,  3,        "1-1/2 Space",    0,         0,                {0}                };
  114.     global DoubleSpaceTool :=     { 3,  3,        "Double Space",    0,         0,                {0}                };
  115.     global IncSpaceTool :=         { 1,  4,        "Increment Space",    0,     0,                {0}                };
  116.     global DecSpaceTool :=         { 2,  4,        "Decrement Space",    0,     0,                {0}                };
  117.  
  118.     # global Tool list
  119.  
  120.     global RulerRect:= {76,40,125,42};
  121.     
  122.     global TabToolList:={    TabLeftTool,
  123.                             TabCenterTool,
  124.                             TabRightTool,
  125.                             TabDecimalTool
  126.     };
  127.  
  128.     global OtherToolList:={    AlignLeftTool,
  129.                             AlignCenterTool,
  130.                             AlignRightTool,
  131.                             AlignLRTool,
  132.                             SingleSpaceTool,
  133.                             xSpaceTool,
  134.                             DoubleSpaceTool,
  135.                             IncSpaceTool,
  136.                             DecSpaceTool
  137.     };
  138.  
  139.     global RulerMenuPath := {'Show Ruler','Format'};
  140.     
  141.     global SelectAllFlag := 1;
  142.     
  143.         ### font characteristic lists
  144.     global gFontSizeList := {'7','9','10','12','14','18', '24','36','48','60','72'};
  145.     global gFontStyleList := {'Bold','Italic','Strike Thru','Outline','Shadow',
  146.     'Underline','Word Underline','Double Underline'};
  147.     
  148.         ### Name of the Plain (style) menu item  ####
  149.     global gPlainStyle := "Plain Text";            # Plain-Style menu item
  150.  
  151.         ### How to get to the next line
  152.     global gNextLineMethod := 1;            
  153.         ### 1 - ReturnKey,  2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
  154.     
  155.         ### Does moving to the next line clear all font info
  156.     global gNextLineClearsFontSettings := 0;
  157.     
  158. end;    #InitAppGlobals
  159.  
  160. #########################################################################
  161. #                        Views()
  162. #========================================================================
  163. # Author:        ML
  164. # Description:    Change Views. 
  165. # Parameters:    None
  166. # Returns:        Nada
  167. # Application:    Word
  168. # Examples:        Views();
  169. #========================================================================
  170. # History:
  171. #
  172. ########################################################################
  173. task Views() 
  174. begin
  175.     LogStr( "Changing Views    ");
  176.     selectMenuItem("Reduced Size", "View");
  177.     selectMenuItem("Side by Side", "View");
  178.     selectMenuItem("Actual Size", "View");
  179. end;
  180.  
  181. ################################################################################
  182. ####################             Main script                    ####################
  183. ################################################################################
  184. script MacWrite (ScriptLevel:= -1)
  185. begin
  186.     InitGlobals(ScriptLevel);
  187.     InitDraw();
  188.     InitFonts();
  189.     global gAppTitle := 'MacWrite II';
  190.     global gAppVersion := '1';        # version of app you will be running
  191.     global gFileName := "@!@-{gBuildVers}-{gAppTitle}";    #This is used in SaveAs when saving files
  192.     SuiteStart('MacWrite.vu');                    # begin a new test suite
  193.     if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
  194.     begin
  195.         InitAppGlobals();
  196.         (*
  197.         *)
  198.         DoSetUpApp(,,,,1,1);
  199.         DoText();
  200.         if (gAppTestLevel = 2)
  201.             DoWPTools();    # Currently can't select tools with mousedown
  202.         Views();
  203.         DoWindow();
  204.         DoCloseApp(1,1,,,2);    # Quit with KeyEq because menu selection fails
  205.     end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
  206.     SuiteEnd();
  207. end; # script MacWrite
  208.  
  209. ### What's Needed/Problems
  210. # Note:Custom mdef makes MacWrite select menuItems move up and down - this can be unreliable.
  211. # Quit with KeyEq because menu selection fails